#ifndef _GLOBAL_H_
#define _GLOBAL_H_

#include <Eigen/Dense>
#include <string>

using namespace std;
using namespace Eigen;

Matrix3d R(string axis, double angle); // 计算x,y,z欧拉旋转矩阵

Matrix3d Antisymmetric(Vector3d vec); // 计算反对称矩阵

// 计算雅克比矩阵,ksi=1时为左腿，ksi=-1时为右腿
// Matrix3d JacobianMatrix(Vector3d vec, int ksi);

// 腿系下运动学逆解
Vector3d inverseKinematics(int legNumber, Vector3d footPosition);

// 腿系下运动学正解
Vector3d forwardKinematics(int legNumber, Vector3d jointPosition);

// 计算雅克比矩阵
Matrix3d calculateJacobian(int legNumber, Vector3d jointPosition);

// 世界坐标系转换到腿坐标系
Vector3d bodyToLeg(int legNumber, Vector3d footPosition);

// 腿坐标系转换到世界坐标系
Vector3d legToBody(int legNumber, Vector3d footPosition);

#endif